package com.eascs.ticket.project.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eascs.ticket.common.dao.BaseDao;

@Repository
public class ProjectModuleDao extends BaseDao {

	public List<Object[]> getProjectModuleDataSouceByProjectId(String projectId) {
		return this.findObjectsList("select id,name from project_module where project_id =  ? order by order_code", projectId);
	}

	public List<Object[]> getProjectModuleByProjectId(String projectId) {
		return this.findObjectsList("select id,name,code,status,comments from project_module where project_id =  ? order by order_code", projectId);
	}

	public List<Object[]> getProjectModuleCodeNameByProjectId(String projectId) {
		return this.findObjectsList("select code,name from project_module where project_id =  ? order by order_code", projectId);
	}
	
	public int countProjectModuleInTicket(String projectId, String moduleId) {
		return this.findInteger("select count(1) from ticket where project_code=? and module_id=? ", projectId, moduleId);
	}

}
